cmake_minimum_required(VERSION 3.10)

project(dal-cyclonedds-test)

include_directories(${PROJECT_SOURCE_DIR}/test_resource/dalidl_generator_cpp)

add_executable(dal_cyclonedds_test_convert_statusmask
    test_convert_statusmask.cc)

add_executable(dal_cyclonedds_test_convert_status
    test_convert_status.cc)

add_executable(dal_cyclonedds_test_convert_qos
    test_convert_qos.cc)

add_executable(dal_cyclonedds_test_convert_ret_type
    test_convert_ret_type.cc)

add_executable(dal_cyclonedds_test_convert_instance_handle
    test_convert_instance_handle.cc)

add_executable(dal_cyclonedds_test_domain_participant
    test_domain_participant.cc)

add_executable(dal_cyclonedds_test_publisher
    test_publisher.cc)

add_executable(dal_cyclonedds_test_subscriber
    test_subscriber.cc)

add_executable(dal_cyclonedds_test_convert_sample_info
    test_convert_sample_info.cc)

add_executable(dal_cyclonedds_test_convert_guid
    test_convert_guid.cc)

add_executable(dal_cyclonedds_test_log
    test_log.cc)

add_executable(dal_cyclonedds_test_identifier
    test_identifier.cc)

add_executable(dal_cyclonedds_test_config_loader
    test_config_loader.cc)

add_executable(dal_cyclonedds_test_domain_config_map
    test_domain_config_map.cc)

add_executable(dal_cyclonedds_test_domain_participant_guid_map
    test_domain_participant_guid_map.cc)

set(test_libs gtest gtest_main pthread)

target_link_libraries(dal_cyclonedds_test_convert_statusmask ${test_libs} dal_cyclonedds)
target_link_libraries(dal_cyclonedds_test_convert_status ${test_libs} dal_cyclonedds)
target_link_libraries(dal_cyclonedds_test_convert_qos ${test_libs} dal dal_cyclonedds)
target_link_libraries(dal_cyclonedds_test_convert_ret_type ${test_libs} dal_cyclonedds)
target_link_libraries(dal_cyclonedds_test_convert_instance_handle ${test_libs} dal_cyclonedds)
target_link_libraries(dal_cyclonedds_test_convert_sample_info ${test_libs} dal_cyclonedds)
target_link_libraries(dal_cyclonedds_test_convert_guid ${test_libs} dal_cyclonedds)
target_link_libraries(dal_cyclonedds_test_domain_participant ${test_libs} dal dal_cyclonedds)
target_link_libraries(dal_cyclonedds_test_publisher ${test_libs} dal dal_cyclonedds)
target_link_libraries(dal_cyclonedds_test_subscriber ${test_libs} dal dal_cyclonedds)
target_link_libraries(dal_cyclonedds_test_log ${test_libs})
target_link_libraries(dal_cyclonedds_test_identifier ${test_libs} dal_cyclonedds)
target_link_libraries(dal_cyclonedds_test_config_loader ${test_libs} dal_cyclonedds)
target_link_libraries(dal_cyclonedds_test_domain_config_map ${test_libs} dal_cyclonedds)
target_link_libraries(dal_cyclonedds_test_domain_participant_guid_map ${test_libs} dal_cyclonedds)

install(TARGETS
        dal_cyclonedds_test_convert_statusmask dal_cyclonedds_test_convert_status
        dal_cyclonedds_test_convert_qos dal_cyclonedds_test_convert_ret_type
        dal_cyclonedds_test_convert_instance_handle dal_cyclonedds_test_convert_sample_info
        dal_cyclonedds_test_convert_guid dal_cyclonedds_test_domain_participant
        dal_cyclonedds_test_publisher dal_cyclonedds_test_subscriber
        dal_cyclonedds_test_log dal_cyclonedds_test_config_loader
        dal_cyclonedds_test_identifier dal_cyclonedds_test_domain_config_map
        dal_cyclonedds_test_domain_participant_guid_map
        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/dal/dal_cyclonedds/test)

install(FILES test_resource/dal_cyclonedds_config.xml test_resource/dal_cyclonedds_config_2.xml
        DESTINATION ${CMAKE_INSTALL_BINDIR}/dal/dal_cyclonedds/test)